home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / MONGOLO.Dxr / 00002.ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  3.6 KB  |  125 lines

  1. on initdeb
  2.   global CheminDisk
  3.   InitBarrette("010")
  4. end
  5.  
  6. on keyDown
  7.   set AccuA to charToNum(the key)
  8.   put AccuA
  9.   if AccuA = 13 then
  10.     CallM("Cson")
  11.     exit
  12.   end if
  13.   if (AccuA > 64) and (AccuA < 91) then
  14.     set numLettre to AccuA - 64
  15.     put numLettre
  16.     set mark to getAt(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"], numLettre)
  17.     go(mark)
  18.   end if
  19.   if (AccuA > 96) and (AccuA < 123) then
  20.     set numLettre to AccuA - 96
  21.     put numLettre
  22.     set mark to getAt(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"], numLettre)
  23.     go(mark)
  24.   end if
  25. end
  26.  
  27. on golettre
  28.   global Glettre
  29.   if Glettre <> "rien" then
  30.     go(Glettre)
  31.   end if
  32. end
  33.  
  34. on vasaumot
  35.   set mot to the text of cast the castNum of sprite (the clickOn - 4)
  36.   set listmotexcept to ["alphabet", "camel", "deal", "gengis khan", "hero", "kazakh", "lamasery", "mafia", "name", "oil", "race", "steppe", "tail", "water"]
  37.   repeat with i = 1 to 14
  38.     if mot = getAt(listmotexcept, i) then
  39.       go(char 1 of mot)
  40.       exit
  41.     end if
  42.   end repeat
  43.   go(mot)
  44. end
  45.  
  46. on initalph
  47.   global Glettre
  48.   set Glettre to "a"
  49.   genmac(1, "mgson09", "011", [20, 21, 22])
  50. end
  51.  
  52. on genmac macson, namesound, fleche, pisteroll
  53.   global Gpisteroll, CheminDisk
  54.   set Gpisteroll to pisteroll
  55.   do("initbarrette" & "(" & QUOTE & fleche & QUOTE & ")")
  56.   updateStage()
  57.   set fichierson to CheminDisk & ":SNDMONG:" & namesound
  58.   set fichierson to MakeSeparator(fichierson)
  59.   SetDcRollTexte()
  60.   if macson = 0 then
  61.     PlaySoundVide(1, "play", fichierson)
  62.     updateStage()
  63.   else
  64.     if macson = 1 then
  65.       PlaySoundTest(1, "play", fichierson)
  66.       updateStage()
  67.     else
  68.       if macson = 2 then
  69.         set Champs to "1  R_MOTLANGUE"
  70.         InitRollTexte(Champs)
  71.       end if
  72.     end if
  73.   end if
  74. end
  75.  
  76. on rolltot
  77.   global Gpisteroll, Glettre
  78.   set pas to 24
  79.   set calage to 8
  80.   if the mouseV < 40 then
  81.     puppetSprite(35, 1)
  82.     repeat with i = 1 to 26
  83.       if ((((i - 1) * pas) + calage) < the mouseH) * (the mouseH < ((i * pas) + calage)) then
  84.         set the locH of sprite 35 to ((i - 1) * pas) + calage
  85.         updateStage()
  86.         set Glettre to getAt(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"], i)
  87.         exit repeat
  88.       end if
  89.     end repeat
  90.   else
  91.     set Glettre to "rien"
  92.     puppetSprite(35, 0)
  93.     updateStage()
  94.   end if
  95.   repeat with i in Gpisteroll
  96.     if rollOver(i) then
  97.       set the castNum of sprite i to the number of cast "CastBoutGall"
  98.       next repeat
  99.     end if
  100.     set the castNum of sprite i to the number of cast "CastBoutG"
  101.   end repeat
  102. end
  103.  
  104. on nicsteph
  105.   Cson()
  106.   set Champs to "MGLAIRAK MGLARMEE MGLBANQ MGLCHAME MGLCHEVA MGLDEL MGLEAU MGLFEMME MGLFETEN MGLGENGI MGLGOBI MGLINVER MGLKAZAK MGLKHOMI MGLLAMAS MGLMASSA MGLNOM MGLSTEPP MGLTHE MGLTIBET MGLVIAND MGLVODKA MGLYAPLU MGLYOURT MGLZANAB "
  107.   set AccuS to 5
  108.   set CoeffV to (the bottom of sprite AccuS - the top of sprite AccuS) / 5
  109.   set CoeffH to (the right of sprite AccuS - the left of sprite AccuS) / 5
  110.   set AccuY to (the mouseV - the top of sprite AccuS) / CoeffV
  111.   set AccuX to (the mouseH - the left of sprite AccuS) / CoeffH
  112.   set AccuP to (AccuY * 5) + AccuX + 1
  113.   set NomFichier to word AccuP of Champs
  114.   set NomMacro to "nicstephTwice(" & QUOTE & NomFichier & QUOTE & ")"
  115.   do(NomMacro)
  116. end
  117.  
  118. on nicstephTwice NomFichier
  119.   global CheminDisk
  120.   set NomFichier to CheminDisk & ":LANGUE:" & NomFichier
  121.   set NomFichier to MakeSeparator(NomFichier)
  122.   PlaySoundTest(1, "Play", NomFichier)
  123.   updateStage()
  124. end
  125.